package com.bdth.model;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 树形
 *
 * @author: 徐斌
 * @Date: 2016-06-20 14:48
 */
public class ZTreeNode implements Serializable {

	private String id;

	private String pId;

	private String name;

	private Boolean checked;

	private Boolean open;

	private String icon;

	private String simNo;//自定义字段

	public int vn = 0;

	public int on = 0;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getpId() {
		return pId;
	}

	public void setpId(String pId) {
		this.pId = pId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Boolean getChecked() {
		return checked;
	}

	public void setChecked(Boolean checked) {
		this.checked = checked;
	}

	public Boolean getOpen() {
		return open;
	}

	public void setOpen(Boolean open) {
		this.open = open;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getSimNo() {
		return simNo;
	}

	public void setSimNo(String simNo) {
		this.simNo = simNo;
	}

	public ZTreeNode() {
		checked = false;
		open = false;
	}

	public ZTreeNode(String _id, String _text, String pId) {
		this.id = (_id);
		name = _text;
		this.pId = (pId);
	}

	public ZTreeNode(String _id, String _text, String pId, String _icon) {
		this.id = (_id);
		name = _text;
		this.icon = _icon;
		this.pId = (pId);
	}

	public ZTreeNode(String _id, String _text, String pId, String _icon, String _simNo) {
		this.id = (_id);
		name = _text;
		this.icon = _icon;
		this.pId = (pId);
		this.simNo = _simNo;
	}

	public ZTreeNode(String _id, String _text, String pId, String _icon, Boolean open) {
		this.id = (_id);
		name = _text;
		this.icon = _icon;
		this.pId = (pId);
		this.open = open;
	}

	public ZTreeNode(String _id, String _text, String pId, String _icon, Boolean open, int _vn, int _on) {
		this.id = (_id);
		vn = _vn;
		on = _on;
		name = _text + "(" + on + "/" + vn + ")";
		this.icon = _icon;
		this.pId = (pId);
		this.open = open;
	}

	public String getNodeId() {
		return this.id;
	}

	public String getIcon() {
		return this.icon;
	}

	public String getText() {
		return name;
	}

	public void setText(String text) {
		this.name = text;
	}


	public Map<String, Object> getNodeStr() {
		Map<String, Object> dic = new HashMap<String, Object>();
		dic.put("name", name);
		dic.put("id", this.id);
		dic.put("pId", pId);

		return dic;
	}

	public Map<String, Object> getUpdateNode() {
		Map<String, Object> dic = new HashMap<String, Object>();
		dic.put("name", name);
		dic.put("id", this.id);
		dic.put("icon", this.icon);

		return dic;
	}


	public Map<String, Object> getVehicleSource() {
		Map<String, Object> dic = new HashMap<String, Object>();
		dic.put("name", name);
		dic.put("id", this.id);
		dic.put("icon", this.icon);
		dic.put("pId", pId);
		return dic;
	}

	public Map<String, Object> getGroupSource() {
		Map<String, Object> dic = new HashMap<String, Object>();
		dic.put("name", name);
		dic.put("pId", "" + pId);
		dic.put("vn", vn);
		dic.put("on", on);

		return dic;
	}


}
